package com.rain.sms.controller;

import com.aliyuncs.exceptions.ClientException;
import com.rain.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Rain
 * @version 1.0
 * @create 2021-6-10-010 10:01
 */
@RestController
public class SmsController {
    @Autowired
    private SmsService smsService;

    @GetMapping("/send/{phone}/{code}")
    public String send(@PathVariable("phone") String phone, @PathVariable("code") String code) throws ClientException {
        return smsService.send(phone, code);
    }
}
